package top.dotgo.dao.base;

import com.querydsl.jpa.impl.JPAQueryFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.persistence.EntityManager;

/**
 * @author : lin
 * @date : 2019/10/11 15:55
 */
@Configuration
public class JPAQueryConfiguration {


    /**
     * 让Spring管理JPAQueryFactory
     *
     * @param entityManager entityManager
     * @return JPAQueryFactory
     */
    @Bean
    public JPAQueryFactory jpaQueryFactory(EntityManager entityManager) {
        return new JPAQueryFactory(entityManager);
    }
}
